/*
 * @Author: Trae AI
 * @Date: 2024-01-15
 * @Description: AI控制器
 */
import { Body, Controller, Post } from '@nestjs/common';
import { AiService } from './ai.service';
import { ChatDto } from './dto/chat.dto';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { Public } from 'src/common/decorators/public.decorator';

@ApiTags('AI服务')
@Controller('ai')
export class AiController {
    constructor(private readonly aiService: AiService) { }

    @Public()
    @Post('chat')
    @ApiOperation({ summary: 'AI聊天' })
    async chat(@Body() chatDto: ChatDto) {
        return await this.aiService.chat(chatDto);
    }
}